// 获得当前根目录
var root = location.href.replace(/\/+$/, "");

var AppX = {
    // 当前 url 中的根目录
    //  比如 localhost:3000/WebAppFrame
    root: root,
    // 应用配置
    //  此配置为应用中 [只读] 的属性项
    //  和下面 runtimeConfig 不同的是,runtimeConfig中的内容是运行过程中逐步构建起来的
    appConfig: {
        "theme": {
            "name": "FoldableTheme",
            "styles": [],
            "customStyles": []
        },
        "title": "阆中燃气GIS系统",
        "subtitle": "A configurable web application",
        "version": "1.0.0",//主版本号.分子版本号.小版本号.日期版本号_阶段标识
        "mainContainer": "#mainContainer",
        "initextent": {},//地图初始范围
       
        "loadOnStartWidgets": [
            {
                "subsys": "gis",
                "name": "Loading",
                "discription": "加载动画",
                "url": "widgets/Loading",
                "main": "Widget",
                "configPath": "",
                "templatePath": "",
                "optional": false
            },
            {
                "subsys": "gis",
                "name": "EndLoading",
                "discription": "结束加载动画",
                "url": "widgets/EndLoading",
                "main": "Widget",
                "configPath": "",
                "templatePath": "",
                "depend": "MenuBar",
                "optional": false
            },
            {
                "subsys": "gis",
                "name": "BaseScene",
                "discription": "基础场景",
                "url": "widgets/BaseScene",
                "main": "Widget",
                "configPath": "",
                "templatePath": "",
                "depend": "BaseWidget",
                "optional": false
            },
           
            {
                "subsys": "gis",
                "name": "SideMenu",
                "discription": "侧边菜单",
                "url": "widgets/SideMenu",
                "main": "Widget",
                "configPath": "",
                "templatePath": "",
                "depend": "BaseWidget",
                "optional": false
            }
        ],
        "menuBarWidgets": [
            {
                "id": "tongyonggongju",
                "label": "通用工具",
                "icon": "/images/tongyonggongju.png",
                "data": [
                    {
                        "subsys": "gis",
                        "id": "tucengkongzhi",
                        "label": "图层控制",
                        "widget": "widgets/LayerList",
                        "main": "Widget",
                        "icon": "/images/choose.png",
                        "inPanel": true,
                        "panel": "Panel",
                        "autorun": false
                    },
                    {
                        "subsys": "gis",
                        "id": "gongzuokongjian",
                        "label": "工作空间",
                        "widget": "widgets/WorkSpace",
                        "main": "Widget",
                        "icon": "/images/choose.png",
                        "inPanel": true,
                        "panel": "Panel",
                        "autorun": false
                    },
                    {
                        "subsys": "gis",
                        "id": "liangcegongju",
                        "label": "量测工具",
                        "widget": "widgets/MeasureTool",
                        "main": "Widget",
                        "icon": "/images/choose.png",
                        "inPanel": true,
                        "panel": "Panel",
                        "autorun": false
                    },
                    {
                        "subsys": "gis",
                        "id": "magnifier",
                        "label": "放大镜",
                        "widget": "widgets/Magnifier",
                        "main": "Widget",
                        "icon": "/images/choose.png",
                        "panel": "Panel",
                        "autorun": false
                    },
                    {
                        "subsys": "gis",
                        "id": "fenpingxianshi",
                        "label": "分屏显示",
                        "widget": "widgets/DoubleScreen",
                        "main": "Widget",
                        "icon": "/images/choose.png",
                        "inPanel": true,
                        "panel": "Panel",
                        "autorun": false
                    },
                    {
                        "subsys": "gis",
                        "id": "shuxingbiaozhu",
                        "label": "属性标注",
                        "widget": "widgets/AttributeAnnotation",
                        "main": "Widget",
                        "icon": "/images/choose.png",
                        "inPanel": true,
                        "panel": "Panel",
                        "autorun": false
                    },
                    {
                        "subsys": "gis",
                        "id": "zhuantituxianshi",
                        "label": "专题图显示",
                        "widget": "widgets/ThematicMap",
                        "main": "Widget",
                        "icon": "/images/choose.png",
                        "inPanel": true,
                        "panel": "Panel",
                        "autorun": false
                    },
                    {
                        "subsys": "gis",
                        "id": "zhitudaying",
                        "label": "制图打印",
                        "widget": "widgets/Printing",
                        "main": "Widget",
                        "icon": "/images/choose.png",
                        "inPanel": true,
                        "panel": "Panel",
                        "autorun": false
                    },
                    {
                        "subsys": "gis",
                        "id": "mobandaying",
                        "label": "模板打印",
                        "widget": "widgets/TemplatePrint",
                        "main": "Widget",
                        "icon": "/images/choose.png",
                        "inPanel": true,
                        "panel": "Panel",
                        "autorun": false
                    },
                    {
                        "subsys": "gis",
                        "id": "yiwenbiaozhi",
                        "label": "疑问标识",
                        "widget": "widgets/QuestionMark",
                        "main": "Widget",
                        "icon": "/images/choose.png",
                        "inPanel": true,
                        "panel": "Panel",
                        "autorun": false
                    }
                ]
            },
        ],
        "gisResource": {
           
        }
    },

    // 运行时配置
    //  用于存放运行时建立的全局变量、全局对象等
    runtimeConfig: {
        map: null,
        toast: null,
        popup: null,
        photoWall: null,
        SideMenu: null,
        dataPanel: null,
        loadMask: null,
        fieldConfig: null,
        unit: null,
        loadWait: null
    },

    // dojo 配置
    //  用于存放 Dojo 相关的配置项
    dojoConfig: {
        packages: [
            {
                name: "root",
                location: root
            },
            {
                name: "core",
                location: root + "/core"
            },
            {
                name: "widgets",
                location: root + "/widgets"
            }
        ]
    }
};

// 全局配置变量
window["AppX"] = AppX;

// 作为模块暴露给其他调用者
export = AppX;
